<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <title>评价</title>
        <link rel="stylesheet" href="<c:url value="/static/wx/css/style.css"/>" />
        <script type="text/javascript" src="<c:url value="/static/wx/js/lib/rem.js"/>"></script>
	</head>
	<body class="bf">
        <div id="wrap">
            <div class="wrap_star">
                <div class="wrap_star_img">
                    <img src="<c:url value="/static/wx/img/star_default_icon.png"/>" />
                    <img src="<c:url value="/static/wx/img/star_default_icon.png"/>" />
                    <img src="<c:url value="/static/wx/img/star_default_icon.png"/>" />
                    <img src="<c:url value="/static/wx/img/star_default_icon.png"/>" />
                    <img src="<c:url value="/static/wx/img/star_default_icon.png"/>" />
                </div>
                <div class="prompt">您对本次服务满意吗</div>
                <ul class="wrap_star_text clearfix">

                </ul>
            </div>

            <div class="wrap_btn none">
                <a href="javascript:void(0)" class="button" id="submit_btn">提交</a>
            </div>
            
            <div class="msg-succ">
                <img src="<c:url value="/static/wx/img/succ_icon.png"/>" /> <span class="f20">提交成功</span> 
            </div>
        </div>
        
        <input type="text" id="bId" value="${list.bId }"/>
        <input type="text" id="label" value="${list.label }"/>
        <input type="text" id="orderId" value="${list.orderId }"/>
        <input type="text" id="score" value="${list.score }"/>
        <script type="text/javascript" src="<c:url value="/static/wx/js/lib/jquery-3.3.1.min.js"/>"></script>
        <script type="text/javascript">
            var bId = $("#bId").val();
            var labelStr = $("#label").val();
            var orderId = $("#orderId").val();
            var score = $("#score").val();
            
            var label=[];
            var htmlStr = "";
            var evaluateVo = {bId: bId, label: labelStr, orderId: orderId, score: score}
            console.log(evaluateVo);
            var score=evaluateVo.score;
            var prompt = ['非常不满意 ，各方面都很差', '不满意 ，比较差', '一般，还需改善', '比较满意 ，仍可改善', '非常满意 ']; //评价提示语
            
            $(".prompt").html(prompt[score-1]);
            
            $('img').each(function(index) {
            	var star = '<c:url value='/static/wx/img/star_default_icon.png'/>'; //普通灰色星星图片的存储路径
                var starRed = '<c:url value='/static/wx/img/star_selected_icon.png'/>'; //红色星星图片存储路径
                this.id = index; //遍历img元素，设置单独的id
                if(index<score){
                    $(this).attr('src', starRed);
                }
            });

            var label = evaluateVo.label.split(",");
            for (var i = 0; i < label.length; i++) {
               htmlStr += '<li class="on">'+label[i]+'</li>';
            }
            $(".wrap_star_text").append(htmlStr);
        </script>
    </body>
</html>